<?php


abstract class BaseArticulos extends BaseObject  implements Persistent {


	
	protected static $peer;


	
	protected $id;


	
	protected $category_id;


	
	protected $type;


	
	protected $image_id;


	
	protected $url;


	
	protected $titulo;


	
	protected $subtitulo;


	
	protected $texto;


	
	protected $referencias;


	
	protected $adelanto;


	
	protected $position;


	
	protected $location;


	
	protected $description;


	
	protected $is_public = true;


	
	protected $is_activated = false;


	
	protected $expires_at;


	
	protected $created_at;


	
	protected $updated_at;

	
	protected $aCategory;

	
	protected $aImage;

	
	protected $alreadyInSave = false;

	
	protected $alreadyInValidation = false;

	
	public function getId()
	{

		return $this->id;
	}

	
	public function getCategoryId()
	{

		return $this->category_id;
	}

	
	public function getType()
	{

		return $this->type;
	}

	
	public function getImageId()
	{

		return $this->image_id;
	}

	
	public function getUrl()
	{

		return $this->url;
	}

	
	public function getTitulo()
	{

		return $this->titulo;
	}

	
	public function getSubtitulo()
	{

		return $this->subtitulo;
	}

	
	public function getTexto()
	{

		return $this->texto;
	}

	
	public function getReferencias()
	{

		return $this->referencias;
	}

	
	public function getAdelanto()
	{

		return $this->adelanto;
	}

	
	public function getPosition()
	{

		return $this->position;
	}

	
	public function getLocation()
	{

		return $this->location;
	}

	
	public function getDescription()
	{

		return $this->description;
	}

	
	public function getIsPublic()
	{

		return $this->is_public;
	}

	
	public function getIsActivated()
	{

		return $this->is_activated;
	}

	
	public function getExpiresAt($format = 'Y-m-d H:i:s')
	{

		if ($this->expires_at === null || $this->expires_at === '') {
			return null;
		} elseif (!is_int($this->expires_at)) {
						$ts = strtotime($this->expires_at);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [expires_at] as date/time value: " . var_export($this->expires_at, true));
			}
		} else {
			$ts = $this->expires_at;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getCreatedAt($format = 'Y-m-d H:i:s')
	{

		if ($this->created_at === null || $this->created_at === '') {
			return null;
		} elseif (!is_int($this->created_at)) {
						$ts = strtotime($this->created_at);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [created_at] as date/time value: " . var_export($this->created_at, true));
			}
		} else {
			$ts = $this->created_at;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getUpdatedAt($format = 'Y-m-d H:i:s')
	{

		if ($this->updated_at === null || $this->updated_at === '') {
			return null;
		} elseif (!is_int($this->updated_at)) {
						$ts = strtotime($this->updated_at);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [updated_at] as date/time value: " . var_export($this->updated_at, true));
			}
		} else {
			$ts = $this->updated_at;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function setId($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->id !== $v) {
			$this->id = $v;
			$this->modifiedColumns[] = ArticulosPeer::ID;
		}

	} 
	
	public function setCategoryId($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->category_id !== $v) {
			$this->category_id = $v;
			$this->modifiedColumns[] = ArticulosPeer::CATEGORY_ID;
		}

		if ($this->aCategory !== null && $this->aCategory->getId() !== $v) {
			$this->aCategory = null;
		}

	} 
	
	public function setType($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->type !== $v) {
			$this->type = $v;
			$this->modifiedColumns[] = ArticulosPeer::TYPE;
		}

	} 
	
	public function setImageId($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->image_id !== $v) {
			$this->image_id = $v;
			$this->modifiedColumns[] = ArticulosPeer::IMAGE_ID;
		}

		if ($this->aImage !== null && $this->aImage->getId() !== $v) {
			$this->aImage = null;
		}

	} 
	
	public function setUrl($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->url !== $v) {
			$this->url = $v;
			$this->modifiedColumns[] = ArticulosPeer::URL;
		}

	} 
	
	public function setTitulo($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->titulo !== $v) {
			$this->titulo = $v;
			$this->modifiedColumns[] = ArticulosPeer::TITULO;
		}

	} 
	
	public function setSubtitulo($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->subtitulo !== $v) {
			$this->subtitulo = $v;
			$this->modifiedColumns[] = ArticulosPeer::SUBTITULO;
		}

	} 
	
	public function setTexto($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->texto !== $v) {
			$this->texto = $v;
			$this->modifiedColumns[] = ArticulosPeer::TEXTO;
		}

	} 
	
	public function setReferencias($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->referencias !== $v) {
			$this->referencias = $v;
			$this->modifiedColumns[] = ArticulosPeer::REFERENCIAS;
		}

	} 
	
	public function setAdelanto($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->adelanto !== $v) {
			$this->adelanto = $v;
			$this->modifiedColumns[] = ArticulosPeer::ADELANTO;
		}

	} 
	
	public function setPosition($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->position !== $v) {
			$this->position = $v;
			$this->modifiedColumns[] = ArticulosPeer::POSITION;
		}

	} 
	
	public function setLocation($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->location !== $v) {
			$this->location = $v;
			$this->modifiedColumns[] = ArticulosPeer::LOCATION;
		}

	} 
	
	public function setDescription($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->description !== $v) {
			$this->description = $v;
			$this->modifiedColumns[] = ArticulosPeer::DESCRIPTION;
		}

	} 
	
	public function setIsPublic($v)
	{

		if ($this->is_public !== $v || $v === true) {
			$this->is_public = $v;
			$this->modifiedColumns[] = ArticulosPeer::IS_PUBLIC;
		}

	} 
	
	public function setIsActivated($v)
	{

		if ($this->is_activated !== $v || $v === false) {
			$this->is_activated = $v;
			$this->modifiedColumns[] = ArticulosPeer::IS_ACTIVATED;
		}

	} 
	
	public function setExpiresAt($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [expires_at] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->expires_at !== $ts) {
			$this->expires_at = $ts;
			$this->modifiedColumns[] = ArticulosPeer::EXPIRES_AT;
		}

	} 
	
	public function setCreatedAt($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [created_at] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->created_at !== $ts) {
			$this->created_at = $ts;
			$this->modifiedColumns[] = ArticulosPeer::CREATED_AT;
		}

	} 
	
	public function setUpdatedAt($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [updated_at] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->updated_at !== $ts) {
			$this->updated_at = $ts;
			$this->modifiedColumns[] = ArticulosPeer::UPDATED_AT;
		}

	} 
	
	public function hydrate(ResultSet $rs, $startcol = 1)
	{
		try {

			$this->id = $rs->getInt($startcol + 0);

			$this->category_id = $rs->getInt($startcol + 1);

			$this->type = $rs->getString($startcol + 2);

			$this->image_id = $rs->getInt($startcol + 3);

			$this->url = $rs->getString($startcol + 4);

			$this->titulo = $rs->getString($startcol + 5);

			$this->subtitulo = $rs->getString($startcol + 6);

			$this->texto = $rs->getString($startcol + 7);

			$this->referencias = $rs->getString($startcol + 8);

			$this->adelanto = $rs->getString($startcol + 9);

			$this->position = $rs->getString($startcol + 10);

			$this->location = $rs->getString($startcol + 11);

			$this->description = $rs->getString($startcol + 12);

			$this->is_public = $rs->getBoolean($startcol + 13);

			$this->is_activated = $rs->getBoolean($startcol + 14);

			$this->expires_at = $rs->getTimestamp($startcol + 15, null);

			$this->created_at = $rs->getTimestamp($startcol + 16, null);

			$this->updated_at = $rs->getTimestamp($startcol + 17, null);

			$this->resetModified();

			$this->setNew(false);

						return $startcol + 18; 
		} catch (Exception $e) {
			throw new PropelException("Error populating Articulos object", $e);
		}
	}

	
	public function delete($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("This object has already been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(ArticulosPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			ArticulosPeer::doDelete($this, $con);
			$this->setDeleted(true);
			$con->commit();
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	public function save($con = null)
	{
    if ($this->isNew() && !$this->isColumnModified(ArticulosPeer::CREATED_AT))
    {
      $this->setCreatedAt(time());
    }

    if ($this->isModified() && !$this->isColumnModified(ArticulosPeer::UPDATED_AT))
    {
      $this->setUpdatedAt(time());
    }

		if ($this->isDeleted()) {
			throw new PropelException("You cannot save an object that has been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(ArticulosPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			$affectedRows = $this->doSave($con);
			$con->commit();
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	protected function doSave($con)
	{
		$affectedRows = 0; 		if (!$this->alreadyInSave) {
			$this->alreadyInSave = true;


												
			if ($this->aCategory !== null) {
				if ($this->aCategory->isModified()) {
					$affectedRows += $this->aCategory->save($con);
				}
				$this->setCategory($this->aCategory);
			}

			if ($this->aImage !== null) {
				if ($this->aImage->isModified()) {
					$affectedRows += $this->aImage->save($con);
				}
				$this->setImage($this->aImage);
			}


						if ($this->isModified()) {
				if ($this->isNew()) {
					$pk = ArticulosPeer::doInsert($this, $con);
					$affectedRows += 1; 										 										 
					$this->setId($pk);  
					$this->setNew(false);
				} else {
					$affectedRows += ArticulosPeer::doUpdate($this, $con);
				}
				$this->resetModified(); 			}

			$this->alreadyInSave = false;
		}
		return $affectedRows;
	} 
	
	protected $validationFailures = array();

	
	public function getValidationFailures()
	{
		return $this->validationFailures;
	}

	
	public function validate($columns = null)
	{
		$res = $this->doValidate($columns);
		if ($res === true) {
			$this->validationFailures = array();
			return true;
		} else {
			$this->validationFailures = $res;
			return false;
		}
	}

	
	protected function doValidate($columns = null)
	{
		if (!$this->alreadyInValidation) {
			$this->alreadyInValidation = true;
			$retval = null;

			$failureMap = array();


												
			if ($this->aCategory !== null) {
				if (!$this->aCategory->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aCategory->getValidationFailures());
				}
			}

			if ($this->aImage !== null) {
				if (!$this->aImage->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aImage->getValidationFailures());
				}
			}


			if (($retval = ArticulosPeer::doValidate($this, $columns)) !== true) {
				$failureMap = array_merge($failureMap, $retval);
			}



			$this->alreadyInValidation = false;
		}

		return (!empty($failureMap) ? $failureMap : true);
	}

	
	public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = ArticulosPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->getByPosition($pos);
	}

	
	public function getByPosition($pos)
	{
		switch($pos) {
			case 0:
				return $this->getId();
				break;
			case 1:
				return $this->getCategoryId();
				break;
			case 2:
				return $this->getType();
				break;
			case 3:
				return $this->getImageId();
				break;
			case 4:
				return $this->getUrl();
				break;
			case 5:
				return $this->getTitulo();
				break;
			case 6:
				return $this->getSubtitulo();
				break;
			case 7:
				return $this->getTexto();
				break;
			case 8:
				return $this->getReferencias();
				break;
			case 9:
				return $this->getAdelanto();
				break;
			case 10:
				return $this->getPosition();
				break;
			case 11:
				return $this->getLocation();
				break;
			case 12:
				return $this->getDescription();
				break;
			case 13:
				return $this->getIsPublic();
				break;
			case 14:
				return $this->getIsActivated();
				break;
			case 15:
				return $this->getExpiresAt();
				break;
			case 16:
				return $this->getCreatedAt();
				break;
			case 17:
				return $this->getUpdatedAt();
				break;
			default:
				return null;
				break;
		} 	}

	
	public function toArray($keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = ArticulosPeer::getFieldNames($keyType);
		$result = array(
			$keys[0] => $this->getId(),
			$keys[1] => $this->getCategoryId(),
			$keys[2] => $this->getType(),
			$keys[3] => $this->getImageId(),
			$keys[4] => $this->getUrl(),
			$keys[5] => $this->getTitulo(),
			$keys[6] => $this->getSubtitulo(),
			$keys[7] => $this->getTexto(),
			$keys[8] => $this->getReferencias(),
			$keys[9] => $this->getAdelanto(),
			$keys[10] => $this->getPosition(),
			$keys[11] => $this->getLocation(),
			$keys[12] => $this->getDescription(),
			$keys[13] => $this->getIsPublic(),
			$keys[14] => $this->getIsActivated(),
			$keys[15] => $this->getExpiresAt(),
			$keys[16] => $this->getCreatedAt(),
			$keys[17] => $this->getUpdatedAt(),
		);
		return $result;
	}

	
	public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = ArticulosPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->setByPosition($pos, $value);
	}

	
	public function setByPosition($pos, $value)
	{
		switch($pos) {
			case 0:
				$this->setId($value);
				break;
			case 1:
				$this->setCategoryId($value);
				break;
			case 2:
				$this->setType($value);
				break;
			case 3:
				$this->setImageId($value);
				break;
			case 4:
				$this->setUrl($value);
				break;
			case 5:
				$this->setTitulo($value);
				break;
			case 6:
				$this->setSubtitulo($value);
				break;
			case 7:
				$this->setTexto($value);
				break;
			case 8:
				$this->setReferencias($value);
				break;
			case 9:
				$this->setAdelanto($value);
				break;
			case 10:
				$this->setPosition($value);
				break;
			case 11:
				$this->setLocation($value);
				break;
			case 12:
				$this->setDescription($value);
				break;
			case 13:
				$this->setIsPublic($value);
				break;
			case 14:
				$this->setIsActivated($value);
				break;
			case 15:
				$this->setExpiresAt($value);
				break;
			case 16:
				$this->setCreatedAt($value);
				break;
			case 17:
				$this->setUpdatedAt($value);
				break;
		} 	}

	
	public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = ArticulosPeer::getFieldNames($keyType);

		if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
		if (array_key_exists($keys[1], $arr)) $this->setCategoryId($arr[$keys[1]]);
		if (array_key_exists($keys[2], $arr)) $this->setType($arr[$keys[2]]);
		if (array_key_exists($keys[3], $arr)) $this->setImageId($arr[$keys[3]]);
		if (array_key_exists($keys[4], $arr)) $this->setUrl($arr[$keys[4]]);
		if (array_key_exists($keys[5], $arr)) $this->setTitulo($arr[$keys[5]]);
		if (array_key_exists($keys[6], $arr)) $this->setSubtitulo($arr[$keys[6]]);
		if (array_key_exists($keys[7], $arr)) $this->setTexto($arr[$keys[7]]);
		if (array_key_exists($keys[8], $arr)) $this->setReferencias($arr[$keys[8]]);
		if (array_key_exists($keys[9], $arr)) $this->setAdelanto($arr[$keys[9]]);
		if (array_key_exists($keys[10], $arr)) $this->setPosition($arr[$keys[10]]);
		if (array_key_exists($keys[11], $arr)) $this->setLocation($arr[$keys[11]]);
		if (array_key_exists($keys[12], $arr)) $this->setDescription($arr[$keys[12]]);
		if (array_key_exists($keys[13], $arr)) $this->setIsPublic($arr[$keys[13]]);
		if (array_key_exists($keys[14], $arr)) $this->setIsActivated($arr[$keys[14]]);
		if (array_key_exists($keys[15], $arr)) $this->setExpiresAt($arr[$keys[15]]);
		if (array_key_exists($keys[16], $arr)) $this->setCreatedAt($arr[$keys[16]]);
		if (array_key_exists($keys[17], $arr)) $this->setUpdatedAt($arr[$keys[17]]);
	}

	
	public function buildCriteria()
	{
		$criteria = new Criteria(ArticulosPeer::DATABASE_NAME);

		if ($this->isColumnModified(ArticulosPeer::ID)) $criteria->add(ArticulosPeer::ID, $this->id);
		if ($this->isColumnModified(ArticulosPeer::CATEGORY_ID)) $criteria->add(ArticulosPeer::CATEGORY_ID, $this->category_id);
		if ($this->isColumnModified(ArticulosPeer::TYPE)) $criteria->add(ArticulosPeer::TYPE, $this->type);
		if ($this->isColumnModified(ArticulosPeer::IMAGE_ID)) $criteria->add(ArticulosPeer::IMAGE_ID, $this->image_id);
		if ($this->isColumnModified(ArticulosPeer::URL)) $criteria->add(ArticulosPeer::URL, $this->url);
		if ($this->isColumnModified(ArticulosPeer::TITULO)) $criteria->add(ArticulosPeer::TITULO, $this->titulo);
		if ($this->isColumnModified(ArticulosPeer::SUBTITULO)) $criteria->add(ArticulosPeer::SUBTITULO, $this->subtitulo);
		if ($this->isColumnModified(ArticulosPeer::TEXTO)) $criteria->add(ArticulosPeer::TEXTO, $this->texto);
		if ($this->isColumnModified(ArticulosPeer::REFERENCIAS)) $criteria->add(ArticulosPeer::REFERENCIAS, $this->referencias);
		if ($this->isColumnModified(ArticulosPeer::ADELANTO)) $criteria->add(ArticulosPeer::ADELANTO, $this->adelanto);
		if ($this->isColumnModified(ArticulosPeer::POSITION)) $criteria->add(ArticulosPeer::POSITION, $this->position);
		if ($this->isColumnModified(ArticulosPeer::LOCATION)) $criteria->add(ArticulosPeer::LOCATION, $this->location);
		if ($this->isColumnModified(ArticulosPeer::DESCRIPTION)) $criteria->add(ArticulosPeer::DESCRIPTION, $this->description);
		if ($this->isColumnModified(ArticulosPeer::IS_PUBLIC)) $criteria->add(ArticulosPeer::IS_PUBLIC, $this->is_public);
		if ($this->isColumnModified(ArticulosPeer::IS_ACTIVATED)) $criteria->add(ArticulosPeer::IS_ACTIVATED, $this->is_activated);
		if ($this->isColumnModified(ArticulosPeer::EXPIRES_AT)) $criteria->add(ArticulosPeer::EXPIRES_AT, $this->expires_at);
		if ($this->isColumnModified(ArticulosPeer::CREATED_AT)) $criteria->add(ArticulosPeer::CREATED_AT, $this->created_at);
		if ($this->isColumnModified(ArticulosPeer::UPDATED_AT)) $criteria->add(ArticulosPeer::UPDATED_AT, $this->updated_at);

		return $criteria;
	}

	
	public function buildPkeyCriteria()
	{
		$criteria = new Criteria(ArticulosPeer::DATABASE_NAME);

		$criteria->add(ArticulosPeer::ID, $this->id);

		return $criteria;
	}

	
	public function getPrimaryKey()
	{
		return $this->getId();
	}

	
	public function setPrimaryKey($key)
	{
		$this->setId($key);
	}

	
	public function copyInto($copyObj, $deepCopy = false)
	{

		$copyObj->setCategoryId($this->category_id);

		$copyObj->setType($this->type);

		$copyObj->setImageId($this->image_id);

		$copyObj->setUrl($this->url);

		$copyObj->setTitulo($this->titulo);

		$copyObj->setSubtitulo($this->subtitulo);

		$copyObj->setTexto($this->texto);

		$copyObj->setReferencias($this->referencias);

		$copyObj->setAdelanto($this->adelanto);

		$copyObj->setPosition($this->position);

		$copyObj->setLocation($this->location);

		$copyObj->setDescription($this->description);

		$copyObj->setIsPublic($this->is_public);

		$copyObj->setIsActivated($this->is_activated);

		$copyObj->setExpiresAt($this->expires_at);

		$copyObj->setCreatedAt($this->created_at);

		$copyObj->setUpdatedAt($this->updated_at);


		$copyObj->setNew(true);

		$copyObj->setId(NULL); 
	}

	
	public function copy($deepCopy = false)
	{
				$clazz = get_class($this);
		$copyObj = new $clazz();
		$this->copyInto($copyObj, $deepCopy);
		return $copyObj;
	}

	
	public function getPeer()
	{
		if (self::$peer === null) {
			self::$peer = new ArticulosPeer();
		}
		return self::$peer;
	}

	
	public function setCategory($v)
	{


		if ($v === null) {
			$this->setCategoryId(NULL);
		} else {
			$this->setCategoryId($v->getId());
		}


		$this->aCategory = $v;
	}


	
	public function getCategory($con = null)
	{
		if ($this->aCategory === null && ($this->category_id !== null)) {
						include_once 'lib/model/om/BaseCategoryPeer.php';

			$this->aCategory = CategoryPeer::retrieveByPK($this->category_id, $con);

			
		}
		return $this->aCategory;
	}

	
	public function setImage($v)
	{


		if ($v === null) {
			$this->setImageId(NULL);
		} else {
			$this->setImageId($v->getId());
		}


		$this->aImage = $v;
	}


	
	public function getImage($con = null)
	{
		if ($this->aImage === null && ($this->image_id !== null)) {
						include_once 'lib/model/om/BaseImagePeer.php';

			$this->aImage = ImagePeer::retrieveByPK($this->image_id, $con);

			
		}
		return $this->aImage;
	}

} 